{extend name="public:base" /}
{block name="css"}
<link href="/static/laydate/theme/default/laydate.css">
{/block}
{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">
                <div class="ibox-title">
                    <h3>总实付金额：{$all_price}元</h3>
                    <h3>已支付：{$all_pay_price}元</h3>
                    <h3>未支付：{:sprintf('%.2f', $all_price - $all_pay_price)}元</h3>
                </div>

                <div class="ibox-content">
                    <div class="row search-form">
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="手机号" name="mobile" value="{:input('mobile')}" type="text" class="form-control form-control-lg">
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请选择开始日期" type="text" name="start_time" value="{:input('start_time')}" class="form-control form-control-lg screen-date" readonly>
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <input placeholder="请选择结束日期" type="text" name="end_time" value="{:input('end_time')}" class="form-control form-control-lg screen-date" readonly>
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <select name="coupon_name" class="form-control form-control-lg">
                                    <option value="">请选择优惠券</option>
                                    {volist name="$coupon_list" id="vo"}
                                    <option value="{$vo.name}" {:input('coupon_name') == $vo.name ? 'selected' : ''}>{$vo.name}</option>
                                    {/volist}
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <select name="is_pay" class="form-control form-control-lg">
                                    <option value="0">请选择支付状态</option>
                                    <option value="1" {:input('is_pay') == 1 ? 'selected' : ''}>已支付</option>
                                    <option value="2" {:input('is_pay') == 2 ? 'selected' : ''}>未支付</option>
                                </select>
                            </div>
                        </div>
                        <div class="col-sm-2 m-b-sm">
                            <div class="input-group">
                                <button type="button" class="btn btn-primary btn-lg screen-btn">搜索</button>
                            </div>
                        </div>
                    </div>
                    <div class="table-responsive">
                        <table class="table table-striped">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>订单号</th>
                                <th>昵称</th>
                                <th>手机号</th>
                                <th>服务</th>
                                <th>优惠券</th>
                                <th>实付金额</th>
                                <th>支付时间</th>
                                <th>订单来源</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.order_sn}</td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.mobile}</td>
                                <td>{$vo.service_name}<br>{$vo.service_price}</td>
                                <td>{if $vo.coupon_price > 0}{$vo.coupon_name}<br>{$vo.coupon_price}{/if}</td>
                                <td>{$vo.pay_price}</td>
                                <td>{$vo.pay_time ? timeFormat($vo.pay_time) : '未支付'}</td>
                                <td>{$vo.from == 1 ? '微信小程序付款' : '线下付款'}</td>
                                <td>{:timeFormat($vo.create_time)}</td>
                                <td>
                                    {if $vo.pay_time > 0}
                                    <a href="{:url('delOrder', ['id' => $vo.id])}" class="btn btn-white btn-sm ajax-del"><i class="iconfont icon-trash"></i> 删除 </a>
                                    {/if}
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                        {if !empty($list)}{$list->render()}{/if}
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>

{/block}

{block name="js"}
<script src="/static/laydate/laydate.js"></script>
<script>
    laydate.render({
        elem: '.screen-date' //指定元素
    });
</script>
{/block}

